package cn.wolfcode.luowowo.search.domain;

import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Document(indexName = "luowowo_ticket", type = "ticket")
@Getter
@Setter
public class TicketTemplate implements Serializable {
    public static final int TICKET_TYPE_SERVICE=0;
    public static final int TICKET_TYPE_HOTSPOT=1;

    @Id
    @Field(store = true, index = true, type = FieldType.Long)
    private Long id;
    @Field(index = true, store = true, type = FieldType.Keyword)
    private int saleNum;
    @Field(index = true, analyzer = "ik_max_word", store = true, searchAnalyzer = "ik_max_word", type = FieldType.Text)
    private String title;
    @Field(store = true, index = true, type = FieldType.Double)
    private BigDecimal minPrice;

    @Field(store = true, index = true, type = FieldType.Date)
    private Date startTime;

    @Field(index = true, store = true, type = FieldType.Keyword)
    private String coverUrl;
    //景点的id
    @Field(store = true, index = true, type = FieldType.Long)
    private long spotId;
    @Field(store = true, index = true, type = FieldType.Long)
    private long destId;
    //景点的名字
    @Field(index = true, analyzer = "ik_max_word", store = true, searchAnalyzer = "ik_max_word", type = FieldType.Text)
    private String spotName;
    @Field(store = true, index = true, type = FieldType.Integer)
    private int spotState;
    @Field(index = true, analyzer = "ik_max_word", store = true, searchAnalyzer = "ik_max_word", type = FieldType.Text)
    private String service;
    @Field(index = true, store = true, type = FieldType.Keyword)
    private String shop;



}
